package com.kaikeba.wx.util;

import com.kaikeba.service.CourierService;
import com.kaikeba.service.UserService;

import java.util.List;

public class IdentityUtil {
    /**
     * 判断身份
     * @return 0 用户;1 快递员;-1 查无此人
     */
    public static int identity(String phone){
        List<String> userPhone = UserService.findUserPhone();
        List<String> courierPhone = CourierService.findCourierPhone();
        for (String s:userPhone) {
            if (s.equals(phone))
                return 0;
        }
        for (String s:courierPhone) {
            if (s.equals(phone))
                return 1;
        }
        return -1;
    }
}
